<template>
  <div>
    <h3>用户详情</h3>
    <button @click="exist">退出登录</button>
  </div>
</template>

<script>
import  {mapMutations} from  "vuex";
export default {
    methods:{
      ...mapMutations("shoppingStore",["clear"]),
        exist(){
            window.localStorage.removeItem("userinfo");
            window.localStorage.removeItem("backUrl");
            window.sessionStorage.removeItem("vuex");
            this.clear();
            this.$emit("changeLogin",false);
        }
    }

}
</script>

<style>

</style>